package org.jprogger.myworld.api.service;

import java.util.HashMap;
import java.util.Map;

import org.jprogger.myworld.api.ApiServiceInvocationException;
import org.jprogger.myworld.api.app.AppContext;
import org.jprogger.myworld.api.response.ApiResponse;
import org.jprogger.myworld.api.response.handler.PublishStreamApiResponseHandler;

public class StreamService extends BaseApiService {

	public StreamService(AppContext context) {
		super(context);
	}
	
	public ApiResponse<Integer> publishToNewsBlock(String description, String postMessage, int imageId)
			throws ApiServiceInvocationException {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("text", description);
		params.put("post", postMessage);
		params.put("img", imageId);
		params.put("method", "audios.linkAudio");
		return apiCall(params, new PublishStreamApiResponseHandler());
	}
}
